﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式.迭代器模式
{
    public class IteratorPatternDemo
    {
        public static void Test()
        {
            NameRepository namesRepository = new NameRepository();

            IIterator iterator = namesRepository.GetIterator();
            while (iterator.HashNext())
            {
                Console.WriteLine(iterator.Next());
            }
        }
    }
}
